clear all
use "Y:\limited\Michigan_CTE\funding_change\data_final\psn_funding.dta" , clear

rename CIPCODE cipcode

drop if cipcode == "01.1001"

gcollapse (sum) funds_state60 funds_cepd40 funds_total, by(year cipcode)

keep if year == 2014 | year == 2017

reshape wide funds_state60 funds_cepd40 funds_total, i(cipcode) j(year)

gen delta60 = round(funds_state602017 - funds_state602014, 1)
gen delta40 = round(funds_cepd402017  - funds_cepd402014, 1)
gen delta_tot = round(funds_total2017 - funds_total2014, 1)

drop if missing(delta60)

// CIP code name
gen cipname = ""
replace cipname = "Agriculture, Agricultural Operations and Related Sciences"       if cipcode == "01.0000"
replace cipname = "Agriculture, Food & Natural Resources"                           if cipcode == "01.0101"
replace cipname = "Applied Horticulture and Horticultural Operations"               if cipcode == "01.0601"
replace cipname = "Animal Health & Veterinary Science"                              if cipcode == "01.0903"
replace cipname = "Natural Resources and Conservation"                              if cipcode == "03.0000"
replace cipname = "Radio & TV Broadcasting Technology"                              if cipcode == "10.0202"
replace cipname = "Graphics and Printing Technology and Communications"             if cipcode == "10.0301"
replace cipname = "Computer Programming/Programmer"                                 if cipcode == "11.0201"
replace cipname = "Digital/Multimedia and Information Resources Design"             if cipcode == "11.0801"
replace cipname = "Computer Systems Networking and Telecommunications"              if cipcode == "11.0901"
replace cipname = "Information Technology"                                          if cipcode == "11.1000"
replace cipname = "Systems Administrator/Administrator"                             if cipcode == "11.1001"
replace cipname = "Computer and Information Systems Security/Information Assurance" if cipcode == "11.1003"
replace cipname = "Cosmetology"                                                     if cipcode == "12.0400"
replace cipname = "Cooking and Related Culinary Arts"                               if cipcode == "12.0500"
replace cipname = "Personal and Culinary Services"                                  if cipcode == "12.9999"
replace cipname = "Education General"                                               if cipcode == "13.0000"
replace cipname = "Mechatronics"                                                    if cipcode == "14.4201"
replace cipname = "Engineering Technology"                                          if cipcode == "15.0000"
replace cipname = "Electro-Mechanical Technology"                                   if cipcode == "15.0403"
replace cipname = "Environmental Engineering Technology/Environmental Technology"   if cipcode == "15.0507"
replace cipname = "Industrial Production"                                           if cipcode == "15.0612"
replace cipname = "Drafting and Design Technology"                                  if cipcode == "15.1301"
replace cipname = "Mechanical Drafting"                                             if cipcode == "15.1306"
replace cipname = "Work and Family Studies"                                         if cipcode == "19.0000"
replace cipname = "Home Furnishings Equipment Installers and Consultants"           if cipcode == "19.0605"
replace cipname = "Child and Custodial Care Services"                               if cipcode == "19.0700"
replace cipname = "Fashion Design"                                                  if cipcode == "19.0906"
replace cipname = "Biotechnology Medical Services"                                  if cipcode == "26.0102"
replace cipname = "Biotechnology"                                                   if cipcode == "26.1201"
replace cipname = "Army (JROTC)"                                                    if cipcode == "28.0301"
replace cipname = "Public Safety/Protective Services"                               if cipcode == "43.0100"
replace cipname = "Construction Trades"                                             if cipcode == "46.0000"
replace cipname = "Electrical and Power Transmission Installation"                  if cipcode == "46.0301"
replace cipname = "Electric Lineman"                                                if cipcode == "46.0303"
replace cipname = "Building Maintenance"                                            if cipcode == "46.0401"
replace cipname = "Pipefitting/Pipefitter and Sprinkler Fitter"                     if cipcode == "46.0502"
replace cipname = "Plumbing Technology"                                             if cipcode == "46.0503"
replace cipname = "Electrical/Electronics Equipment Installation and Repair"        if cipcode == "47.0101"
replace cipname = "Heating, Air Conditioning, Ventilation and Refrigeration"        if cipcode == "47.0201"
replace cipname = "Heavy Industrial Equipment Maintenance Technologies"             if cipcode == "47.0399"
replace cipname = "Collision Repair Technician"                                     if cipcode == "47.0603"
replace cipname = "Automotive Technician"                                           if cipcode == "47.0604"
replace cipname = "Small Engine & Related Equipment Repair"                         if cipcode == "47.0606"
replace cipname = "Airframe Technology"                                             if cipcode == "47.0607"
replace cipname = "Power Plant Technology (Aircraft)"                               if cipcode == "47.0608"
replace cipname = "Avionics Maintenance Technology"                                 if cipcode == "47.0609"
replace cipname = "Medium/Heavy Truck Technician"                                   if cipcode == "47.0613"
replace cipname = "Marine Maintenance"                                              if cipcode == "47.0616"
replace cipname = "Precision Production Trades General"                             if cipcode == "48.0000"
replace cipname = "Machine Tool Technology/Machinist"                               if cipcode == "48.0501"
replace cipname = "Welding, Brazing and Soldering"                                  if cipcode == "48.0508"
replace cipname = "Woodworking General"                                             if cipcode == "48.0701"
replace cipname = "Aeronautics/Aviation Aerospace Science & Technology"             if cipcode == "49.0101"
replace cipname = "Visual & Performing Arts"                                        if cipcode == "50.0101"
replace cipname = "Visual Communications Technology"                                if cipcode == "50.0401"
replace cipname = "Therapeutic Services"                                            if cipcode == "51.0000"
replace cipname = "Health Informatics"                                              if cipcode == "51.0707"
replace cipname = "Diagnostic Services"                                             if cipcode == "51.1000"
replace cipname = "Business Administration Management and Operations"               if cipcode == "52.0299"
replace cipname = "Finance & Financial Management Services"                         if cipcode == "52.0800"
replace cipname = "Insurance"                                                       if cipcode == "52.1701"
replace cipname = "Marketing, Sales and Service"                                    if cipcode == "52.1999"
replace cipname = "Arts & Comm CoOp-Cap Coord"                                      if cipcode == "AC.0000"
replace cipname = "BMMT CoOp-Cap Coord"                                             if cipcode == "BT.0000"
replace cipname = "CoOp-Cap Coordination"                                           if cipcode == "CC.0000"
replace cipname = "EMIT CoOp-Cap Coord"                                             if cipcode == "EM.0000"
replace cipname = "Family & Consumer Sciences"                                      if cipcode == "FP.0000"
replace cipname = "Health Svcs CoOp-Cap Coord"                                      if cipcode == "HE.0000"
replace cipname = "Human Svcs CoOp-Cap Coord"                                       if cipcode == "HU.0000"
replace cipname = "New & Emerging"                                                  if cipcode == "NE.0000"
replace cipname = "Nat Res & Agri CoOp-Cap Coord"                                   if cipcode == "NR.0000"

// KEEP VARIABLES
keeporder cipname cipcode delta60 delta40 delta_tot

